<div class="form-inline">
  <div class="form-inline pull-left">
  </div>
  <div class="pull-right">
    <!--<input type="text" style="width:300px;" class="form-control" [(ngModel)]="searchData" name="searchData"-->
           <!--placeholder="请输入邀请码或者openId">-->
    <!--<button class="btn btn-default" (click)="search()">检索</button>-->
    <!--<button class="btn btn-default" (click)="reset()">重置</button>-->
    <!--<button type="button" class="btn btn-success" (click)="showAddModal()">新建邀请码</button>-->
  </div>
</div>
<div class="table-responsive">
  <nz-spin [nzTip]="'正在读取推送列表...'" [nzSpinning]="_isSpinning" [nzSize]="'large'" class="admin-spin">
    <table class="table">
      <thead>
      <tr>
        <th>id</th>
        <th>活动名称</th>
        <th>所属活动</th>
        <th>推送时间</th>
        <th>创建时间</th>
        <th>推送状态</th>
        <th>备注</th>
        <th>操作</th>
      </tr>
      </thead>
      <tbody>
      <tr *ngFor="let item of pushList">
        <td>{{ item.id }}</td>
        <td>{{ item.title }}</td>
        <td>{{ item.activity ? item.activity.title: '' }}</td>
        <td>{{ item.send_time }}</td>
        <td>{{ item.created_at }}</td>
        <td>{{ status[item.status] }}</td>
        <td>{{ item.remark }}</td>
        <td>
          <a href="javascript:;"(click)="goEdit(item.id,item.activity_id,true)">查看</a>
          <a href="javascript:;" *ngIf="item.status == 1" (click)="goEdit(item.id,item.activity_id)">编辑</a>
          <!--<a href="javascript:;" (click)="showConfirmModal(item.id)">删除</a>-->
        </td>
      </tr>
      </tbody>
    </table>
  </nz-spin>
  <div class="text-center">
    <ng-container *ngIf="totalItems">
      <pagination (pageChanged)="pageChanged($event)" [totalItems]="totalItems" [(ngModel)]="currentPage"
                  [itemsPerPage]="itemsPerPage"
                  [maxSize]="10"
                  previousText="&lsaquo;" nextText="&rsaquo;" firstText="&laquo;" lastText="&raquo;"
                  [boundaryLinks]="true" class="pagination-sm"></pagination>
    </ng-container>
  </div>
</div>

<app-notification [type]="type" [message]="message" [isShow]="isShow"
                  (promptIsShow)="isShow = $event;"></app-notification>

<div class="modal fade" bsModal #confirmModal="bs-modal" tabindex="-1">
  <div class="modal-dialog modal-xs">
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title pull-left">温馨提示</h4>
        <button type="button" class="close pull-right" aria-label="Close" (click)="confirmModal.hide()">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <div class="form-group clearfix">
          <p>您确定要删除吗？</p>
        </div>
        <form>
          <div class="text-center mt20">
            <button class="btn btn-default btn-md-long" type="button" (click)="confirmModal.hide();">取消</button>
            <button class="btn btn-success btn-md-long" type="submit"
                    (click)="deletePush();">确定
            </button>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>
